Ext.namespace('VAS');

VAS.MainWindow = function($config) {
	
	var _this = this;
	
    var $height;
	_this._getHeight = function(_height,_y) {
		if (typeof(_height) !== "undefined") {
			if (typeof(_height)==='string'&&_height.indexOf('%') > -1) {
				$height = document.body.clientHeight -_y-190;			
			} else if(typeof(_height)==='number'){
				$height = _height - 50;
			}
		} 
		return $height;
	}
	
	var shortcutPanel  = new VAS.ShortcutPanel({
		frame         : true,
		height            : _this._getHeight($config.height,$config.y),
		list : {
			loadUrl : "admin/system/ShortcutAction!getShortcut.action"
		}
	});
	
	_this._getWinWidth = function(_width,_x) {			
		var $width;
		if (typeof(_width) !== "undefined") {
			if (typeof(_width)==='string'&&_width.indexOf('%') > -1) {
			$width = document.body.clientWidth -_x-134;	
			alert($width);
			} else if(typeof(_width)==='number'){
				$width = _width;
			}
		} 
		return $width;
	}
	
	var thisConfig = {
		title         :'桌面',
		id            : 'shortCut',
		frame         : true,
		layout        : 'fit',
		viewConfig : {
			forceFit : true
		},
//		width         : _this._getWinWidth($config.width,$config.x),
		items         : shortcutPanel
	};
	var _config = $config || {};
	Ext.apply(_this, Ext.apply(_config, thisConfig));
	VAS.MainWindow.superclass.constructor.call(_this);

};

Ext.extend(VAS.MainWindow,VAS.BasicWindow,{

});

Ext.reg('mainwindow-win',VAS.MainWindow);

